<?php
/*
	This file is part of PGallery; a FrogCMS plugin.

	PGallery is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	PGallery is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with PGallery.  If not, see <http://www.gnu.org/licenses/>.
*/


$PDO = Record::getConnection();
$driver = strtolower($PDO->getAttribute(Record::ATTR_DRIVER_NAME));


if($driver == 'mysql'){
	
	$PDO->exec("CREATE TABLE ".TABLE_PREFIX."pgallery_categories (
					id int(10) unsigned NOT NULL auto_increment,
					parent_id int(10) unsigned default NULL,
					visible tinyint(1) unsigned NOT NULL,
					name varchar(50) NOT NULL,
					slug varchar(50) NOT NULL,
					description text,
					PRIMARY KEY (id),
					KEY slug (slug)
				) ENGINE=MyISAM DEFAULT CHARSET=utf8;");	
	
	$PDO->exec("CREATE TABLE ".TABLE_PREFIX."pgallery_images (
					id int(10) unsigned NOT NULL auto_increment,
					category_id int(10) unsigned NOT NULL,
					name varchar(50) NOT NULL,
					slug varchar(50) NOT NULL,
					description text,
					filename varchar(50) NOT NULL,
					PRIMARY KEY (id),
					KEY category_id (category_id)
				) ENGINE=MyISAM DEFAULT CHARSET=utf8;");

}

/* End of file: pgallery/enable.php */